home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gsl.idb / usr / freeware / include / gsl_histogram.h.z / gsl_histogram.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  1.6 KB  |  52 lines

  1. #ifndef GSL_HISTOGRAM_H 
  2. #define GSL_HISTOGRAM_H 
  3.  
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6.  
  7. typedef struct {
  8.   size_t n ;
  9.   double * range ;
  10.   double * bin ;
  11. } gsl_histogram ;
  12.  
  13. typedef struct {
  14.   size_t n ;
  15.   double * range ;
  16.   double * sum ;
  17. } gsl_histogram_pdf ;
  18.  
  19. gsl_histogram * gsl_histogram_calloc (size_t n);
  20. gsl_histogram * gsl_histogram_calloc_uniform (size_t n, double xmin, 
  21.                          double xmax);
  22. void gsl_histogram_free (gsl_histogram * h);
  23. int gsl_histogram_increment (gsl_histogram * h, double x);
  24. int gsl_histogram_accumulate (gsl_histogram * h, double x, double weight);
  25. int gsl_histogram_find (const gsl_histogram * h, 
  26.             double x, size_t * i);
  27. int gsl_histogram_find_impl (size_t n, const double range[],
  28.                  double x, size_t * i);
  29.  
  30. double gsl_histogram_get (const gsl_histogram * h, size_t i);
  31. int gsl_histogram_get_range (const gsl_histogram * h, size_t i, 
  32.                  double * lower, double * upper);
  33.                      
  34. double gsl_histogram_max (const gsl_histogram * h);
  35. double gsl_histogram_min (const gsl_histogram * h);
  36. size_t gsl_histogram_bins (const gsl_histogram * h);
  37.  
  38. void gsl_histogram_reset (gsl_histogram * h);
  39.  
  40. int gsl_histogram_fwrite (FILE * stream, const gsl_histogram * h) ;
  41. int gsl_histogram_fread (FILE * stream, gsl_histogram * h);
  42. int gsl_histogram_fprintf (FILE * stream, const gsl_histogram * h, 
  43.                const char * range_format, const char * bin_format);
  44. int gsl_histogram_fscanf (FILE * stream, gsl_histogram * h);
  45.  
  46. gsl_histogram_pdf * gsl_histogram_pdf_alloc (const gsl_histogram * h);
  47. void gsl_histogram_pdf_free (gsl_histogram_pdf * p);
  48. double gsl_histogram_pdf_sample (const gsl_histogram_pdf * p, double r);
  49.  
  50. #endif /* GSL_HISTOGRAM_H */
  51.  
  52.